import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

//郑贝
import Myhome from '../views/Myhome'
// import Mydingdan from '../views/Mydingdan'
// import Search from '../views/Search'
//张秋+后台
import Backstage from '../views/Backstage.vue'
import User from '../views/User.vue'
import Weal from '../views/Weal.vue'
import Order from '../views/Order.vue'
import Seeding from '../views/Seeding.vue'
import Commodity from '../views/Commodity.vue'
//注册路由配置
// import Register from '../views/Register.vue'
// //登录路由配置
// import Login from '../views/Login.vue'

// //沈彬鹏
import Me from '../views/Me.vue'
import News from '../views/News.vue'
// import Word from '../views/Word.vue'
import Live from '../views/Live.vue'
// import Studio from '../views/Studio.vue'
// import Assist from '../views/Assist.vue'
// import Setting from '../views/Setting.vue'
// import Service from '../views/Service.vue'
// import ShoppingAddress from '../views/ShoppingAddress.vue'
// import CardVoucher from '../views/CardVoucher.vue'
// import Admin from '../views/Admin.vue'
// import About from '../views/About.vue'
// import AddAddress from '../views/AddAddress.vue'
// //刘自豪
// import Details from '../views/Details.vue'
import Shopping from '../views/Shopping.vue'

//赵沛翔
// import Collect from '../views/Collect.vue'
// import History from '../views/History.vue'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Myhome
  },
  {
    path: '/dingdan',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "dingdan" */ '../views/Mydingdan.vue')
  },
  {
    path: '/me',
    component: Me
  },

  {
    path: '/assist',
    name: 'Assist',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "assist" */ '../views/Assist.vue')
  },
  {
    path: '/setting',
    name: 'Setting',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "setting" */ '../views/Setting.vue')
  },
  {
    path: '/service',
    name: 'Service',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "service" */ '../views/Service.vue')
  },
  
  {
    path: '/news',
    name: 'News',
    component:News
  },
  {
    path: '/word',
    name: 'Word',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "word" */ '../views/Word.vue')
  },
  {
    path: '/live',
    name: 'Live',
    component: Live
  },
  {
    path: '/studio',
    name: 'Studio',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "studio" */ '../views/Studio.vue')
  },
  {
    path: '/shoppingaddress',
    name: 'ShoppingAddress',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "shoppingaddress" */ '../views/ShoppingAddress.vue')
  },
  {
    path: '/addaddress',
    name: 'AddAddress',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "addaddress" */ '../views/AddAddress.vue')
  },
  {
    path: '/cardvoucher',
    name: 'CardVoucher',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "cardvoucher" */ '../views/CardVoucher.vue')
  },
  {
    path: '/details',
    name: 'Details',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "details" */ '../views/Details.vue')
  },
  {
    path: '/shopping',
    name: 'Shopping',
    component: Shopping
  },
  {
    path: '/history',
    name: 'History',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "history" */ '../views/History.vue')
  },
  {
    path: '/collect',
    name: 'Collect',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "collect" */ '../views/Collect.vue')
  },
  {
    path: '/search',
    name: 'Search',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "search" */ '../views/Search.vue')
  },
  {
    path: '/alogin',
    name: 'Admin',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "alogin" */ '../views/Admin.vue')
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'Login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue')
  },
  {
    path:'/register',
    name:'Register',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "register" */ '../views/Register.vue')
  },
  {
    path: '/admin',
    name: 'Backstage',
    component: Backstage,
    children:[
      {
        path:'user',
        component:User
      },
      {
        path:'commodity',
        component:Commodity
      },
      {
        path:'order',
        component:Order
      },
      {
        path:'seeding',
        component:Seeding
      },
      {
        path:'weal',
        component:Weal
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
